namespace KnowledgeQA.Web.Models
{
    /// <summary>
    /// API配置模型
    /// </summary>
    public class ApiSettings
    {
        /// <summary>
        /// API基础URL
        /// </summary>
        public string BaseUrl { get; set; } = string.Empty;

        /// <summary>
        /// 文档API配置
        /// </summary>
        public DocumentApi DocumentApi { get; set; } = new();

        /// <summary>
        /// 问答API配置
        /// </summary>
        public QaApi QaApi { get; set; } = new();

        /// <summary>
        /// 请求超时时间（毫秒）
        /// </summary>
        public int Timeout { get; set; } = 30000;

        /// <summary>
        /// 重试次数
        /// </summary>
        public int RetryCount { get; set; } = 3;
    }

    /// <summary>
    /// 文档API配置
    /// </summary>
    public class DocumentApi
    {
        /// <summary>
        /// 基础URL
        /// </summary>
        public string BaseUrl { get; set; } = string.Empty;

        /// <summary>
        /// 端点配置
        /// </summary>
        public DocumentEndpoints Endpoints { get; set; } = new();
    }

    /// <summary>
    /// 文档API端点
    /// </summary>
    public class DocumentEndpoints
    {
        /// <summary>
        /// 获取文档列表
        /// </summary>
        public string List { get; set; } = "/list";

        /// <summary>
        /// 上传文档
        /// </summary>
        public string Upload { get; set; } = "/upload";

        /// <summary>
        /// 获取文档详情
        /// </summary>
        public string Detail { get; set; } = "/{id}";

        /// <summary>
        /// 删除文档
        /// </summary>
        public string Delete { get; set; } = "/{id}";

        /// <summary>
        /// 更新文档
        /// </summary>
        public string Update { get; set; } = "/{id}";

        /// <summary>
        /// 处理文档
        /// </summary>
        public string Process { get; set; } = "/{id}/process";

        /// <summary>
        /// 重新处理文档
        /// </summary>
        public string Reprocess { get; set; } = "/{id}/reprocess";

        /// <summary>
        /// 获取文档统计
        /// </summary>
        public string Stats { get; set; } = "/stats";
    }

    /// <summary>
    /// 问答API配置
    /// </summary>
    public class QaApi
    {
        /// <summary>
        /// 基础URL
        /// </summary>
        public string BaseUrl { get; set; } = string.Empty;

        /// <summary>
        /// 端点配置
        /// </summary>
        public QaEndpoints Endpoints { get; set; } = new();
    }

    /// <summary>
    /// 问答API端点
    /// </summary>
    public class QaEndpoints
    {
        /// <summary>
        /// 获取会话列表
        /// </summary>
        public string Sessions { get; set; } = "/sessions";

        /// <summary>
        /// 获取会话详情
        /// </summary>
        public string SessionDetail { get; set; } = "/sessions/{id}";

        /// <summary>
        /// 获取会话消息
        /// </summary>
        public string SessionMessages { get; set; } = "/sessions/{id}/messages";

        /// <summary>
        /// 发送消息
        /// </summary>
        public string Chat { get; set; } = "/chat";

        /// <summary>
        /// 单轮问答
        /// </summary>
        public string Ask { get; set; } = "/ask";

        /// <summary>
        /// 提交反馈
        /// </summary>
        public string Feedback { get; set; } = "/feedback";

        /// <summary>
        /// 导出会话
        /// </summary>
        public string Export { get; set; } = "/sessions/{id}/export";

        /// <summary>
        /// 获取问答统计
        /// </summary>
        public string Stats { get; set; } = "/stats";
    }
} 